<?php
//测试控制器类
class IndexController extends CommonController{
	public $model;
	public function __init(){
		parent::__init();
        header('Content-type: text/html;charset=utf-8');
	}
	
	
    //动作方法
    public function index(){
	$this->topCate();

        // 调取品牌数据
		$brandData = M()->join('__brands__ b JOIN __brands_cate__ bc ON b.brands_cate_bcid=bc.bcid')->all();
//		p($brandData);die;
        $brand = K('Brands')->all();
        $this->assign('brand',$brand);
//		p($brand);die;
		//调取品牌分类数据
		$BrandsCate = K('BrandsCate')->all();
		$this->assign('BrandsCate',$BrandsCate);
//		p($BrandsCate);
		$goods = M()->join('__brands__ b JOIN __goods__ g ON b.bid=g.brands_bid')->all();
//		p($goods);
//		$goods = K('Goods')->all();
		$this->assign('goods',$goods);
		
        $this->display();
    }
	
	public function _list(){
		$this->display();
	}
}
